Skip to content

Curation P1 (#255): one published opening on /on/love - #256

Merged
holden merged 4 commits into
mainfrom
claude/255-published-opening
Oct 23, 2026
Merged

holden merged 4 commits into
mainfrom
claude/255-published-opening

Conversation

@holden

@holden holden commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Delivery A of #255 (P1 of #254, under #253). The word page now reads what a reviewer published: /on/love shows its composition, /words/14794/love shows nothing, and a withdrawal shows on the next request. Nothing here touches v2. Delivery B (the live proof on v2) waits for the owner's yes in chat.

What changed

  • Curation.PublishedReader (new) implements Curation.OpeningReader for the published origin. It resolves the scope by §3.1: Configurations.resolve_default/0, then Compositions.active(config.id, :lexical_page, language, Compositions.signature(ids of page.headword.lexemes)), then Published.current/1. It maps the answer onto %Opening{origin: :published} as §4 lists, field by field. It re-checks nothing Published settled: no eligibility, no binding table, no schema change. Reads only.
  • Curation.Opening.reader/1 returns PublishedReader by default. ManualFixture answers only when :curated_opening_fixtures is set and ?opening=fixture is asked, as before.
  • WordLive already called Opening.for_page/2 in load/5 on every fresh request. The reader is now never nil, so only the comments changed.
  • DevilsDictionaryWeb.Opening gains the published branch (§5.2):
    • Configuration, Selected by, Published by (label, date, version, receipt), Panel ("None: published by the operator."), Withheld and Composition rows. The four assessment rows are absent, not blank (P5's).
    • The fixture banner stays fixture-only. The fixture's rows are unchanged.
    • withheld_reason/1 is public and labels every reason the record emits (36 atoms, table-tested), with the plain fallback.
    • A withheld lead, or a withheld highlight, renders a short card in its own place (§2.3), never the withheld content.
    • The summary shares the title's line ("How this was curated · Published 23 October 2026 · global-default v1"), as §2.1 draws it.
  • One paragraph under Deferred in docs/curation/persistence-slice-1.md (§5.1). Published's moduledoc no longer says no page reads it.

Tests

Tests 1–14 of §6 are in the two files §5.1 names: test/devils_dictionary/curation/published_reader_test.exs (1–8: 45 tests with test 8's table, plus a rejected-claim case under test 5) and test/devils_dictionary_web/live/word_live_opening_test.exs (9–14, plus the §2.3 withheld cards: 9 tests through /on/love, /on/patience and /words/:id/love). Four existing assertions changed because §4 and §2.6 change them:

  • the gate tests now expect PublishedReader where they expected nil;
  • the component's two published-row assertions now expect the Composition and Configuration rows §2.6 specifies.

Precommit (MIX_ENV=test MIX_TEST_PARTITION=_curation_p1 DD_NO_OBAN=1 mix precommit): 19 doctests, 2,836 tests, 1 failure. The one failure is RecoverySourceIdentityTest (routing, untouched here); see limitation 9. With a shorter partition (MIX_TEST_PARTITION=_cp1) the same precommit is 19 doctests, 2,836 tests, 0 failures.

Demonstration (test partition, real routes)

On a private test-env database (devils_dictionary_test_curation_p1_demo), with love built from the committed opening fixtures: the verb at object id 9051 and the noun at 14794, as on v2, so the routes read /on/love and /words/14794/love. Served on 127.0.0.1:4017; 4007 was never touched. Every call was the real service, as one reviewer account (user 1, actor label Account #1), in Delivery B's order:

Step Call Id
seed Configurations.seed!/0 configuration 1 global-default (draft), version 1 (bierce_first_v1), 5 proposed profiles
activate Configurations.activate/4, key p1-255-activate-1 activation receipt 1
provision Compositions.provision/3, :lexical_page, [9051, 14794], en composition 1, signature 653f3ba4…
version Compositions.create_version/3, notes from the author version 1: item 1 lead Bierce LOVE/n (content 14795, rev 1); item 2 highlight 1 Johnson LOVE n. s. (content 14796, rev 2); item 3 highlight 2 Milton under sense 14799 (rev 3, quotation:1)
review Reviews.decide/4 :accepted, key p1-255-review-1 review 1
publish Publications.publish/3, key p1-255-love-1, expected_pointer: nil publication receipt 1
load GET /on/love the opening (§2.1); Definitions heading at 946 px; /words/14794/love shows none
supersede Registry.add_sense_revision/2 on sense 14799 (words unchanged) sense revision 3 → 5; highlight 2 withheld :revision_superseded (§2.3)
withdraw Publications.withdraw/3, key p1-255-love-withdraw-1 withdrawal receipt 2
load GET /on/love no section; Definitions heading at 390 px (§2.4)

Counts before seed → after publish: curation_configurations 0 → 1, curation_configuration_versions 0 → 1, curator_profiles 0 → 5, editorial_compositions 0 → 1, editorial_composition_items 0 → 3, editorial_composition_publications 0 → 1 (→ 2 after withdraw), oban_jobs 0 → 0. The 12 oban_jobs present after withdraw are all Discovery.RunWorker, enqueued by the browser's first connected page loads (discovery's refresh-on-visit). Publish and withdraw enqueued nothing.

Screenshots

Every <details> closed unless the name says open. Taken before 1c4465a's lead-rule fix, which renders identically for a Bierce lead, and after its layout changes. 1280 × 900 at 1×; 375 × 812 at 2×; "section" is the whole opening at 375.

§2.1 published, 1280 × 900. Definitions heading at 946 px (limitation 1).

§2.2 the disclosure open, 1280. Configuration, Selected by, Published by, Panel, Withheld, Composition; no assessment rows.

§2.5 phone, 375: first screen, and the whole opening. One column, lead first, disclosure collapsed. "Read the whole entry", "The entry among the definitions" and each "Why this is here" are 44 px tall; no horizontal scroll.

§2.3 one item withheld (sense revision 3 superseded by 5), 1280, closed and open, and 375. The slot keeps a short card; nothing of the quotation is shown; the disclosure names it.


§2.4 withdrawn, 1280 and 375. No heading, no skeleton; the page begins at Definitions (390 px at 1280).

§2.6 the fixture, for comparison (?opening=fixture, test config), 1280, its disclosure, and 375. Banner, "Selection … not a published composition", "Reviewed by: Nobody yet", "Configuration: None…"; no Published by, no Panel. Its Definitions heading is at 1,232 px.


§2.7 /words/14794/love while /on/love is published, 1280. Nothing; Definitions at 209 px.

Not taken: §2.2 at 375, because the demo's composition had been superseded and withdrawn by then. The open disclosure is the same rows in one column.

Independent review, addressed

One independent review (a fresh agent, code only) found no blockers and three should-fixes, all taken in 1c4465a:

  • The reader re-checked the lead. It used LeadPolicy.check/2 on the page's cards, which count a Bierce entry whose defines claim a reviewer rejected, where Published.current/1 had applied LeadRule. A valid fallback lead was withheld as :priority_source_available. A shown lead's rule now follows its source; LeadPolicy only words it and finds its card. The new test fails on the old code with exactly that error.
  • The tests could not tell publisher from reviewer, or a stored note label from a current one. Now a second reviewer publishes, and the author is renamed after writing.
  • No page test rendered the withheld cards. Two now do, and assert that nothing of the withheld item is shown.

Its nits were taken too: Highlight.register admits :definition, and for_page/2's doc no longer mentions a missing reader. The lead link's tap-target class is noted under limitation 4.

Limitations, said plainly

  1. Update, 23 October: the owner chose the typographic lever; 7cb26a5 takes it. The heading now starts at 882 px, and its line ends at 910 px (see the comment). What follows is the original finding.
    The height budget is not met: the Definitions heading is at 946 px at 1280 × 900, budget 900. As first built it was 1,006. The spec's lever, quoting the lead's first sentence, was already applied. Two changes inside the published branch brought it to 946: §2.1's one-line disclosure summary, and the definition tile's chip in its caption. The remaining excess is mostly Johnson's required CC BY credit, five lines at half width, together with the 4xl lead. Measured in the browser (CSS only, nothing committed):

    Also… Heading
    nothing more (this PR) 946
    move the Johnson tile's credits into its Why this is here (its card below still carries them) 946 (the quotation tile then sets the row)
    set the lead quote one step smaller on desktop (sm:text-4xl/12 → text-3xl/10), shared with the fixture 882

    Both remaining levers change something outside this issue: the lead's Phase 1 typography, or the rule that a licence's credit sits next to the item. That's the owner's call, so this PR does neither. Say which and it's a one-line follow-up.

  2. The exact-word page cannot have a :lexical_page composition beside the On page's. [14794] overlaps [9051, 14794], so Compositions.provision/3 refuses it ({:overlapping_scope, [id]}, K3). That's why §2.7's page shows nothing. Test 7 therefore provisions the exact word as a :lexeme scope, which this reader does not read, and asserts the refusal.

  3. WordPage has no language_tag. §5.1 says to pass page.language_tag. The reader takes the language from page.headword.lexemes[].language. A page whose words span languages has no lexical-page scope, so it gets no opening.

  4. A definition highlight needed a tile. §5.2 does not list one, but §2.1 and §5.3 put Johnson's entry in a highlight. The component drew only artworks, quotations and exemplars, so I added a :definition kind and tile. It quotes the entry's whole first block (Johnson numbers his senses, so a first sentence would be "1."). Its "Read the whole entry" link, and the lead's, are 44 px tap targets on a phone (§2.5); the lead's link is shared with the fixture.

  5. work and exemplar highlights are withheld as :unsupported_item. P1's composition pins neither (§5.3), and mapping them is later parts' work (the pin, P3). They are named, never drawn.

  6. Opening.Configuration.resolution_policy_version is 1 by definition. resolve_default/1 has one policy (C7) and returns no version number. Struct fields were added: Configuration.lead_rule, Review.published_by/published_on/receipt_id and state :published, Highlight.excerpt and kind :definition. These are view-model fields, not schema.

  7. Who is named is the actor's label. Selected by, Published by and each note's signature show the label the database recorded (Compositions.author_label/1): Account #N unless that actor row carries another. The wireframe's "Holden (operator)" appears only if the owner's actor row says "Holden". P1 renames nothing.

  8. An open page does not update on withdrawal. The next request shows nothing (test 11). Prompt reader stability is Curation agent MVP: what an editor does, what a curated entry contains, how the page looks, how the owner and the bots share one record, and how it stays current (under #193) #253 §6a, P5.

  9. Precommit on _curation_p1: recovery_source_identity_test.exs names scratch databases "#{base}_identity_#{System.unique_integer}_source_renamed". With this partition the base is 34 characters, so once the integer reaches five digits, as it does deep in a full run, the name is 64 bytes and Postgres refuses it ("expected a binary string of less than 64 bytes"). Alone, the file passes, on this branch and on main. Run to run, one or two of its tests fail. It is the partition name's, not this change's, so this PR does not touch the test. Fixing it (hash or truncate the name) is a small issue of its own.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Public word pages now display reviewer-published curated openings by default, with publication details, attribution, notes, and supported highlights.
    • Sourced definition highlights include excerpts, citations, and links to the remaining text.
    • Unavailable or unsupported content is identified with an explanation; withdrawals appear on a fresh page load.
    • Development fixture openings remain available only when enabled and explicitly requested.
  • Documentation
    • Updated guidance to describe published openings, fixture access, and content scope.

holden and others added 3 commits October 23, 2026 18:49
…position, the exact word shows nothing (#255)

Curation.PublishedReader is the default opening reader. A page's
composition is the active :lexical_page composition of the resolved
global default whose signature is the page's own lexemes
(Compositions.active/4), read through Published.current/1 and mapped
onto %Curation.Opening{}: the lead's rule and register from LeadPolicy,
a definition highlight by its entry's opening block, a quotation by its
line, each note as a reason signed with its stored author label, and the
configuration, author and publication receipt. Nothing Published settled
is checked again; a work or exemplar highlight is withheld as
:unsupported_item. The fixture still answers only behind
:curated_opening_fixtures and ?opening=fixture.

The Opening component gains the published branch: a definition tile,
withheld cards in a withheld item's own place, a disclosure of
Configuration, Selected by, Published by, Panel, Withheld and
Composition, and withheld_reason/1 for every reason the record gives,
with a fallback. The fixture's rows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hort card in its place, and the disclosure's summary shares its title's line (#255, the independent review)

The reader no longer asks LeadPolicy.check/2 of the page's cards, which
count a Bierce entry whose defining claim a reviewer rejected: a fallback
lead Published.current/1 showed was withheld as :priority_source_available.
A shown lead's rule now follows its source, and LeadPolicy only words it
and finds its card. A withheld card is as tall as its words; the
definition tile carries its register in its caption; the published
summary sits beside "How this was curated", as #255 §2.1 draws it.

Tests: a second reviewer publishes and the author is renamed after
writing, so published_by, reviewed_by and each note's stored signature
are told apart; a rejected Bierce defining claim keeps a Johnson lead;
the withheld highlight's and lead's cards render in their places, with
nothing of what they withheld.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ture, and of /words/14794/love, on a test partition (#255 §2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0e68233d-54df-4d29-b8f5-0c6a21d7fa40
📥 Commits

Reviewing files that changed from the base of the PR and between 50a6a96 and 7cb26a5.

⛔ Files ignored due to path filters: 3
  • docs/discovery/issue-255-p1-published-love-1280-light-first-screen-2026-10-23.png is excluded by !**/*.png
  • docs/discovery/issue-255-p1-published-love-375-light-first-screen-2026-10-23.png is excluded by !**/*.png
  • docs/discovery/issue-255-p1-published-love-375-light-section-2026-10-23.png is excluded by !**/*.png
📒 Files selected for processing: 1
  • lib/devils_dictionary_web/components/opening.ex
🚧 Files skipped from review as they are similar to previous changes: 1
  • lib/devils_dictionary_web/components/opening.ex

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

Word pages now use PublishedReader by default to read active published compositions for the page’s word scope. The opening model and component display publication details, supported highlights, and withheld items. The development fixture remains available only when enabled and explicitly requested.

Changes: Published opening flow

Layer / File(s) Summary
Opening contracts and reader selection
lib/devils_dictionary/curation/opening.ex, lib/devils_dictionary/curation/opening/configuration.ex, lib/devils_dictionary/curation/opening/highlight.ex, lib/devils_dictionary/curation/opening/review.ex
The opening model includes publication metadata, the configured lead rule, and definition-highlight fields. Public pages select PublishedReader unless the enabled fixture is explicitly requested.
Published composition lookup and mapping
lib/devils_dictionary/curation/published_reader.ex, lib/devils_dictionary/curation/published.ex, test/devils_dictionary/curation/published_reader_test.exs, docs/curation/persistence-slice-1.md
PublishedReader resolves configuration and page scope, reads the active composition and publication, and maps supported content into an opening. Tests cover publication, withdrawal, scope, lead selection, and withheld reasons.
Opening rendering and page integration
lib/devils_dictionary_web/components/opening.ex, lib/devils_dictionary_web/live/word_live.ex, test/devils_dictionary_web/components/opening_test.exs, test/devils_dictionary_web/live/*opening*test.exs
The component displays published provenance, definition highlights, and withheld positions. LiveView tests cover fixture gating, page scope, and changes visible on a fresh request.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant WordLive
  participant Opening
  participant PublishedReader
  participant OpeningComponent
  WordLive->>Opening: Select reader from request parameters
  Opening-->>WordLive: Return PublishedReader by default
  WordLive->>PublishedReader: Read opening for page
  PublishedReader->>PublishedReader: Resolve configuration and page-word scope
  PublishedReader->>PublishedReader: Find active composition and current publication
  PublishedReader-->>WordLive: Return opening model or nil
  WordLive->>OpeningComponent: Render opening model
Loading

Possibly related issues

  • razrfly/dictionary#255: Covers published-reader behavior, default word-page behavior, withdrawal handling, fixture gating, and withheld-item rendering.
  • razrfly/dictionary#253: Defines the curated-opening contract; this change implements its published-reader portion.
  • razrfly/dictionary#257: Continues the public opening with operator curation and more highlight types; this change provides the published-opening reader and presentation it extends.
  • razrfly/dictionary#254: Tracks reading published compositions on word pages, which this change implements.
  • razrfly/dictionary#193: Tracks the sourced curated opening and Bierce-first lead, which this change includes.

Possibly related PRs

Merge Risk: ⚪ Minimal · up to 7cb26

The desktop height adjustment meets the agreed target, and no issue identified here blocks merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 5.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: delivering one published opening on /on/love. It is concise and directly matches the pull request objectives.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…tarts at 882 px at 1280 × 900 (#255, the owner's decision on #256)

The lead quote keeps text-3xl/10 at every width; sm:text-4xl/12 is gone,
for the published opening and the fixture alike. The §2.1 desktop and §2.5
phone screenshots are re-taken; the phone's first screen now starts at the
top of the page, at the headword.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@holden

holden commented Oct 23, 2026 •

Copy link
Copy Markdown
Member Author

The height lever, taken (the owner's decision 1 on #255)

7cb26a5: the lead quote is text-3xl/10 at every width; sm:text-4xl/12 is gone. The class is in the one lead component, so the published opening and the fixture both get it. Nothing else changed.

Height at 1280 × 900, every <details> closed (measured in the browser on a fresh test partition, devils_dictionary_test_cp1_demo, with the same composition as before: configuration 1, composition 1, version 1, publication receipt 1):

Before (50a6a96) Now (7cb26a5)
Definitions heading, top 946 px 882 px
Definitions heading, bottom of its line 974 px (946 + its 28 px line; not measured then) 910 px

One thing to see before merging: the heading starts inside the first 900 px but its 28 px line ends 10 px past the fold. At exactly 1280 × 900 the word "Definitions" is cut in half (first screenshot). If the budget means the whole heading must show, it is 10 px short. I took no further lever.

Precommit (MIX_ENV=test MIX_TEST_PARTITION=_cp1 DD_NO_OBAN=1 mix precommit): 19 doctests, 2,836 tests, 0 failures. The first run had 18 failures, all of them DBConnection queue_timeout at pool checkout. Spotlight was indexing and the load average was 25, and none of the failures touched this change. I stopped my own demo server and re-ran on the same code: green.

Re-taken screenshots (§2.1 desktop, §2.5 phone; the phone's first screen is at scroll 0 and starts at the headword):

§2.1 published, 1280 × 900

§2.5 phone, 375 × 812 at 2×: first screen, then the whole opening

The phone's lead type is unchanged (it was already text-3xl/10 below 640 px). Only the first screen's scroll position differs from the earlier shot.

Ready to merge. Delivery B waits for the merge and then the owner's yes in chat.

@holden
holden merged commit 8b6e2c9 into main Oct 23, 2026
2 checks passed
@holden
holden deleted the claude/255-published-opening branch November 7, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant